package org.idea.qiyu.framework.rpc.dubbo.router.starter.zone;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.registry.Registry;
import org.apache.dubbo.registry.support.AbstractRegistryFactory;
import org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter;

/**
 * @Author linhao
 * @Date created in 4:19 下午 2021/8/1
 */
public class ZoneAwareZookeeperRegisterFactory extends AbstractRegistryFactory {

    private ZookeeperTransporter zookeeperTransporter;

    public void setZookeeperTransporter(ZookeeperTransporter zookeeperTransporter) {
        this.zookeeperTransporter = zookeeperTransporter;
    }

    @Override
    protected Registry createRegistry(URL url) {
        return new ZoneAwareZookeeperRegister(url, zookeeperTransporter);
    }
}
